#ifndef SYSTEMMONITOR_H
#define SYSTEMMONITOR_H

#include <string>

struct SystemInfo {
    double cpu_percent;
    double memory_percent;
    double disk_percent;
    std::string os_name;
    std::string kernel_version;
    std::string hostname;
    int uptime_hours;
    int uptime_minutes;
    int uptime_seconds;
    double load_average_1min;
    double load_average_5min;
    double load_average_15min;
    int processes_total;
    int processes_running;
    int processes_sleeping;
    std::string cpu_model;
    int cpu_cores;
    long long network_rx_bytes;
    long long network_tx_bytes;
    double memory_total_mb;
    double memory_used_mb;
    double disk_total_gb;
    double disk_used_gb;
    double disk_read_speed_mbs;   // 添加磁盘读取速度
    double disk_write_speed_mbs;  // 添加磁盘写入速度
};

class SystemMonitor {
public:
    SystemMonitor();
    virtual ~SystemMonitor();
    
    SystemInfo get_system_info();
    
private:
    unsigned long long m_last_cpu_total;
    unsigned long long m_last_cpu_idle;
    long long m_last_network_rx_bytes;
    long long m_last_network_tx_bytes;
    long long m_last_disk_read_bytes;   // 添加磁盘读取字节数跟踪
    long long m_last_disk_write_bytes;  // 添加磁盘写入字节数跟踪
};

#endif // SYSTEMMONITOR_H